//
//  SEConfirmReserveDoctorInfoCell.swift
//  SmartEyeForPatient
//
//  Created by QDSG on 2021/4/7.
//

import UIKit

class SEConfirmReserveDoctorInfoCell: UITableViewCell {

    override func awakeFromNib() {
        super.awakeFromNib()
        backgroundColor = .background
        contentView.backgroundColor = .background
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
    func update(with viewModel: SEHospitalizeOrderDetailViewModel) {
        avatarView.kf.setAvatarImage(urlString: viewModel.model.otherPhoto)
        nameLabel.text = viewModel.model.doctorName
        jobTitleLabel.text = viewModel.jobAndDeptDescribe
    }
    
    @IBOutlet private weak var containerView: UIView! {
        didSet {
            containerView.setLayerCorners(rect: containerView.bounds, radius: 16, corners: [.topLeft, .topRight])
        }
    }
    
    @IBOutlet private weak var avatarView: UIImageView! {
        didSet {
            avatarView.setLayerCorners(rect: avatarView.bounds,
                                       radius: avatarView.height / 2)
        }
    }
    @IBOutlet private weak var nameLabel: UILabel!
    @IBOutlet private weak var jobTitleLabel: UILabel!
    @IBOutlet private weak var hospitalLabel: UILabel!
}
